package com.net.service.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.net.dao.ResourceDao;
import com.net.model.Resource;
import com.net.service.ResourceService;
@Component("resourceService")
public class ResourceServiceImpl implements ResourceService {
	private ResourceDao resourceDao ;

	public ResourceDao getResourceDao() {
		return resourceDao;
	}
	@javax.annotation.Resource(name="resourceDao")
	public void setResourceDao(ResourceDao resourceDao) {
		this.resourceDao = resourceDao;
	}
	public boolean delete(Resource u) {
		return resourceDao.delete(u);
	}
	public List<Resource> getResources(int currentPage, int perPage, String orderType,
			String orderName) {
		return resourceDao.getResources(currentPage, perPage, orderType, orderName);
	}
	public List<Resource> getResourcesByCondition(int currentPage, int perPage,
			String condition) {
		return resourceDao.getResourcesByCondition(currentPage, perPage, condition);
	}
	public Resource loadResourceById(int id) {
		return resourceDao.loadResourceById(id);
	}
	public Resource loadResourceByName(String name) {
		return resourceDao.loadResourceByName(name);
	}
	public void add(Resource u) {
		resourceDao.save(u);
	}
	public void update(Resource resource) {
		resourceDao.update(resource);
	}
	public int getCount(){
		return resourceDao.getCount();
	}
}
